/**
 * 
 */
package com.vanstone.imgapp.api.img;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.vanstone.common.services.AbstractBusinessObject;
import com.vanstone.fs.weedfs.WeedFSFile;
import com.vanstone.imgapp.datacollect.ICollectPlugin;

/**
 * @author shipeng <br />
 * 
 */
public class AbstractArticle extends AbstractBusinessObject {

  private static final long serialVersionUID = 1166599725649763667L;

  private Long id;
  private String title;
  private String brief;
  private String content;
  private WeedFSFile coverFile;
  private Date sysInsertTime;
  private long clickcount = 0;
  private long clickcountInRedis = 0;
  private ArticleType articleType;
  private List<Tag> tags = new ArrayList<>();
  private long commentcount = 0;
  private String collectSource;
  private String collectSourceMD5;
  private ICollectPlugin collectPlugin;
  private Category category;

  public Category getCategory() {
    return category;
  }

  public void setCategory(Category category) {
    this.category = category;
  }

  protected AbstractArticle(ArticleType articleType) {
    this.articleType = articleType;
  }

  @Override
  public Long getId() {
    return this.id;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  public WeedFSFile getCoverFile() {
    return coverFile;
  }

  public void setCoverFile(WeedFSFile coverFile) {
    this.coverFile = coverFile;
  }

  public Date getSysInsertTime() {
    return sysInsertTime;
  }

  public void setSysInsertTime(Date sysInsertTime) {
    this.sysInsertTime = sysInsertTime;
  }

  public long getClickcount() {
    return clickcount;
  }

  public void setClickcount(long clickcount) {
    this.clickcount = clickcount;
  }

  public ArticleType getArticleType() {
    return articleType;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public long getClickcountInRedis() {
    return clickcountInRedis;
  }

  public void setClickcountInRedis(long clickcountInRedis) {
    this.clickcountInRedis = clickcountInRedis;
  }

  public List<Tag> getTags() {
    return tags;
  }

  public void setTags(List<Tag> tags) {
    this.tags = tags;
  }

  public long getCommentcount() {
    return commentcount;
  }

  public void setCommentcount(long commentcount) {
    this.commentcount = commentcount;
  }

  public String getCollectSource() {
    return collectSource;
  }

  public void setCollectSource(String collectSource) {
    this.collectSource = collectSource;
  }

  public String getCollectSourceMD5() {
    return collectSourceMD5;
  }

  public void setCollectSourceMD5(String collectSourceMD5) {
    this.collectSourceMD5 = collectSourceMD5;
  }

  public ICollectPlugin getCollectPlugin() {
    return collectPlugin;
  }

  public void setCollectPlugin(ICollectPlugin collectPlugin) {
    this.collectPlugin = collectPlugin;
  }

  public String getBrief() {
    return brief;
  }

  public void setBrief(String brief) {
    this.brief = brief;
  }

  public void addTag(Tag tag) {
    if (tag == null) {
      return;
    }
    this.tags.add(tag);
  }

  public void addTags(List<Tag> tags) {
    if (tags == null || tags.size() <= 0) {
      return;
    }
    this.tags.addAll(tags);
  }

}
